<?php
/**
 * Created by PhpStorm.
 * User: Jerry
 * Date: 2016/11/21
 * Time: 9:43
 */

namespace SDXApi\Model;

use Think\Model;

/**
 * Class PickupHandleLogModel
 * @package SDXApi\Model
 */
class PickupHandleLogModel extends Model
{
    /**
     * @var string
     */
    protected $tableName = 'pickup_handle_log';


    /**
     * 插入脚本操作日志
     * Created by Jerry
     * @param $logData
     * @return mixed
     */
    public function insert_pickup_handle_log($logData)
    {

        if (empty($logData)) {
            return false;
        }

        if ($this->create($logData)) {
            return $this->add();
        }

        throw_exception($this->getError());
    }

	/**
	 * 返回当前商品所存在的行数
	 * Created by Jerry
	 * @param $order_id
	 * @return mixed
	 */
    public function get_pickup_handle_log_by_order_id($order_id)
    {
        $where = array(
        	'order_id'	=>	$order_id,
		);

		return $this->where($where)->count();
    }
}